Use G_STRLOC instead __FILE__ and __LINE__
authorJavier Jardon <jjardon@gnome.org>
Wed, 21 Oct 2009 18:46:44 +0000 (21:46 +0300)
committerTor Lillqvist <tml@iki.fi>
Wed, 21 Oct 2009 18:48:00 +0000 (21:48 +0300)
Patch from bug #599225

gdk/win32/gdkmain-win32.c
gdk/win32/gdkprivate-win32.h

index 5142dae97cd03d2905ea9731d17671867582fc3c..49bd59e61754d2b36ed415c418454713562f0ce7 100644 (file)
@@ -118,20 +118,18 @@ _gdk_windowing_init (void)
 
 void
 _gdk_win32_api_failed (const gchar *where,
-                     gint         line,
                      const gchar *api)
 {
   gchar *msg = g_win32_error_message (GetLastError ());
-  g_warning ("%s:%d: %s failed: %s", where, line, api, msg);
+  g_warning ("%s: %s failed: %s", where, api, msg);
   g_free (msg);
 }
 
 void
 _gdk_other_api_failed (const gchar *where,
-                     gint         line,
                      const gchar *api)
 {
-  g_warning ("%s:%d: %s failed", where, line, api);
+  g_warning ("%s: %s failed", where, api);
 }
 
 void
index a2f653c6bf5949cbd7a8a8849ebdf8e85fd76a66..26e5e7d480725a6ba2b603ea7d8faae213401454 100644 (file)
@@ -349,21 +349,13 @@ gchar *_gdk_win32_gdkregion_to_string    (const GdkRegion    *box);
 
 gchar  *_gdk_win32_last_error_string (void);
 void    _gdk_win32_api_failed        (const gchar *where,
-                                    gint line,
                                     const gchar *api);
 void    _gdk_other_api_failed        (const gchar *where,
-                                    gint line,
                                     const gchar *api);
 
-#if defined(__GNUC__) && (__GNUC__ < 3)
-#define WIN32_API_FAILED(api) _gdk_win32_api_failed (__FILE__ ":" __PRETTY_FUNCTION__, __LINE__, api)
+#define WIN32_API_FAILED(api) _gdk_win32_api_failed (G_STRLOC , api)
 #define WIN32_GDI_FAILED(api) WIN32_API_FAILED (api)
-#define OTHER_API_FAILED(api) _gdk_other_api_failed (__FILE__ ":" __PRETTY_FUNCTION__, __LINE__, api)
-#else
-#define WIN32_API_FAILED(api) _gdk_win32_api_failed (__FILE__, __LINE__, api)
-#define WIN32_GDI_FAILED(api) WIN32_API_FAILED (api)
-#define OTHER_API_FAILED(api) _gdk_other_api_failed (__FILE__, __LINE__, api)
-#endif
+#define OTHER_API_FAILED(api) _gdk_other_api_failed (G_STRLOC, api)
  
 /* These two macros call a GDI or other Win32 API and if the return
  * value is zero or NULL, print a warning message. The majority of GDI